//
//  ShoppingCartAnimationTool.h
//  xfb
//
//  Created by XFB on 2022/6/28.
//  Copyright © 2022 XFB. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

typedef void (^AnimationFinishBlock)(BOOL finish);

@interface ShoppingCartAnimationTool : NSObject

@property (nonatomic, strong) CALayer * _Nullable layer;
@property (nonatomic, copy) AnimationFinishBlock animationFinishBlock;

/// 实例化 instancetype
+ (instancetype)sharedTool;

/// 开始动画
/// @param view 添加动画的view
/// @param rect view 的绝对frame
/// @param finishPoint 下落的位置
/// @param completion 动画完成回调
- (void)startAnimationandView:(UIView *)view
                         rect:(CGRect)rect
                  finisnPoint:(CGPoint)finishPoint
                  finishBlock:(AnimationFinishBlock)completion;

@end

NS_ASSUME_NONNULL_END
